<?php
namespace Home\Controller;
use Think\Controller;
/**
* ==============================================
* URL：http://www.liuhuanhui.cn
* ==============================================
* @date：2014-11-13
* @time：下午9:05:50
* @author：liuhuanhui
* @encoding：UTF-8
*/
class PhotoController extends Controller
{
	/**
	 * 显示所有相册
	 */
    public function index()
    {
    	$photo=D('Manager/PhotosortsView');
    	$this->photosorts=$photo->select();
    	$this->display();
    }
	
    /**
     * 相片查看
     */
    function view()
    {	
    	$this->sort_id=I('id');
    	$this->display();
    }
    
    function getimages()
    {
    	$photos=M('photos');
    	$where=array(photosort_id=>I('id'));
    
    	$this->images=$photos->where($where)->order('name')->select();
    	$str=json_encode($this->images);
    	$this->ajaxReturn($str);
    }
}